package ticketmachine.logic.priceStrategies;

import ticketmachine.logic.Ticket;

public class DiscountPerCentCalculatorStratagy implements IPriceCalculatorStrategy{

	@Override
	public float calculatePrice(Ticket t) {
		float price=t.getPrice();
		float percentage=t.getPromotion().getDiscount();


                //TEST
                System.out.println("Calculating ticket price with discount");
                System.out.println("Discount type is " + t.getPromotion().getName());
                System.out.println("Discount amount is" + t.getPromotion().getDiscount());
                System.out.println("Price before discount is " + t.getPrice());
                System.out.println("Price with discount is " + String.valueOf(price-(price*percentage/100)));

		return price-(price*percentage/100);
	}

}
